import QtQuick 1.0
import "common"
Item {
    id:root
    signal clicked(int index)
    function get(index)
    {
        return fruitModel.get(index)

    }

    ListModel {
        id: fruitModel

        ListElement {
            name: "Connection"
            content: ""
            logo:"gfx/settings.png"
            path:"ConnectionPage.qml"
        }
        ListElement {
            name: "Close connection"
            content: "close current connection"
            logo:"gfx/apport.png"
            path:"close"
        }

        ListElement {
            name: "Queue"
            content: "4 action in queue"
            logo:"gfx/task.png"
             path:"QueuePage.qml"
        }
        ListElement {
            name: "About"
            content: "About this application"
            logo:"gfx/help.png"
             path:"AboutPage.qml"
        }
        ListElement {
            name: "Quit"
            content: "Quit"
            logo:"gfx/exit.png"
             path:""
        }
    }

    ListView {
        id:view
        model:fruitModel
        clip: true
        width: root.width
        height: root.height
        delegate: OMenuItem {
            enabled: index>0&&index<3 ? ftpModel.state : true
            title: name
            subTitle: !index ? ftpModel.stateName(ftpModel.state) : content
            icon:logo
            onClicked:root.clicked(index)
        }


    }
}
